package com.example.homework_20221008.product;

import com.example.homework_20221008.InsuranceProduct;

import java.math.BigDecimal;

public class PropertyInsurance implements InsuranceProduct<Double> {

    private String name = "";

    private double amount;

    private BigDecimal rate = new BigDecimal("0.001");

    public PropertyInsurance() {
        this.amount = 6000000;
    }

    public double getAmount() {
        return amount;
    }

    public double calculate(Double value) {
        return BigDecimal.valueOf(value).multiply(rate).doubleValue();
    }

}
